﻿using System;
using System.Collections.Generic;
using Zeus.Domain.MySql.Contract;
using Zeus.Biz.MySql.EF.Model;
using Zeus.Biz.MySql.EF.Repository;
using Zeus.Mvc.Infrastructure.Model;

namespace Zeus.Domain.MySql.Service
{
    public class CustomerService
    {
        public CustomerResponse GetCustomerResponse()
        {
            CustomerResponse response = new CustomerResponse();

            try
            {
                CustomerRepository repository = new CustomerRepository();
                List<Customer> customers = repository.GetAllCustomers();

                response.Status = ResponseStatus.SUCCESS;
                response.Message = "Call Success";
                response.ListData = customers;
            }
            catch (Exception ex)
            {
                response.Status = ResponseStatus.ERROR;
                response.Message = ex.ToString();
            }

            return response;
        }
    }
}
